home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / ada / adaed-1.11 / adaed-1 / Adaed-1.11.0a / errmsg.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-07  |  29.8 KB  |  811 lines

  1. /*
  2.  * Copyright (C) 1985-1992  New York University
  3.  * 
  4.  * This file is part of the Ada/Ed-C system.  See the Ada/Ed README file for
  5.  * warranty (none) and distribution info and also the GNU General Public
  6.  * License for more details.
  7.  
  8.  */
  9. #include "hdr.h"
  10. #include "vars.h"
  11. #include "miscprots.h"
  12. #include "chapprots.h"
  13. #include "smiscprots.h"
  14. #include "errmsgprots.h"
  15.  
  16. static char *strings[5];
  17.  
  18. static char *insert(char *, int);
  19.  
  20. #ifdef TBSN
  21.     unit := FIND_UNIT(node);    
  22.      find unit in which node was created.
  23.     [u_name, file] := unit;
  24.     if (file ? AISFILE) /= AISFILE then     $ node from previous compunit
  25.         header := "in " + u_name(1) + " " + u_name(2);
  26.         header +:= "", in file "" + file + " :";
  27.         ERR_LIST([p_s, 12, msg+header]);
  28.     else    $ node in current compilation unit
  29.         ERR_LIST([p_s, 12, msg]);
  30.     end if;
  31. #endif
  32.  
  33. void errmsg_id(char *msg, Symbol name, char *lrm, Node node)    /*;errmsg_id*/
  34. {
  35.     strings[0] = ORIG_NAME(name);
  36.     errmsg(insert(msg, 1), lrm, node);
  37. }
  38.  
  39. void errmsg_str(char *msg, char *str, char *lrm, Node node)        /*;errmsg_str*/
  40. {
  41.     strings[0] = str;
  42.     errmsg(insert(msg, 1), lrm, node);
  43. }
  44.  
  45. void errmsg_nat(char *msg, Symbol sym, char *lrm, Node node)    /*;errmsg_nat*/
  46. {
  47.     strings[0] = nature_str(NATURE(sym));
  48.     errmsg(insert(msg, 1), lrm, node);
  49. }
  50.  
  51. void errmsg_type(char *msg, Symbol type, char *lrm, Node node)    /*;errmsg_type*/
  52. {
  53.     strings[0] = full_type_name(type);
  54.     errmsg(insert(msg, 1), lrm, node);
  55. }
  56.  
  57. void errmsg_nval(char *msg, Node name, char *lrm, Node node)    /*;errmsg_nval*/
  58. {
  59.     strings[0] = N_VAL(name);
  60.     errmsg(insert(msg, 1), lrm, node);
  61. }
  62.  
  63. void errmsg_id_id(char *msg, Symbol name1, Symbol name2, char *lrm, Node node)
  64.                                                             /*;errmsg_id_id*/
  65. {
  66.     strings[0]     = ORIG_NAME(name1);
  67.     strings[1] = ORIG_NAME(name2);
  68.     errmsg(insert(msg, 2), lrm, node);
  69. }
  70.  
  71. void errmsg_id_type(char *msg, Symbol name, Symbol type, char *lrm, Node node)
  72.                                                             /*;errmsg_id_type*/
  73. {
  74.     strings[0]     = ORIG_NAME(name);
  75.     strings[1] = full_type_name(type);
  76.     errmsg(insert(msg, 2), lrm, node);
  77. }
  78.  
  79. void errmsg_nat_id_str(char *msg, Symbol sym, Symbol name, char *str, char *lrm,
  80.   Node node)                                            /*;errmsg_nat_id_str*/
  81. {
  82.     char *name_str;
  83.  
  84.     strings[0] = nature_str(NATURE(sym));
  85.     name_str = ORIG_NAME(name);
  86.     if (name_str[0] == '#') name_str = "#BLOCK";
  87.     strings[1] = name_str;
  88.     strings[2] = str;
  89.  
  90.     errmsg(insert(msg, 3), lrm, node);
  91. }
  92.  
  93. void errmsg_str_id(char *msg, char *str, Symbol name, char *lrm, Node node)
  94.                                                             /*;errmsg_str_id*/
  95. {
  96.     strings[0]     = str;
  97.     strings[1] = ORIG_NAME(name);
  98.     errmsg(insert(msg, 2), lrm, node);
  99. }
  100.  
  101. void errmsg_str_num(char *msg, char *str, int i, char *lrm, Node node)
  102.                                                         /*;errmsg_str_num*/
  103. {
  104.     char numstr[5];
  105.  
  106.     strings[0] = str;
  107.     sprintf(numstr, "%d", i);
  108.     strings[1] = numstr;
  109.  
  110.     errmsg(insert(msg, 2), lrm, node);
  111. }
  112.  
  113. static char *insert(char *in_format, int nstrings)                /*;insert*/
  114. {
  115.     /*  -in_format- is a character string containing an error message, and 1 or
  116.      *  more "substitution" (%) characters to be replaced by the character
  117.      *  strings pointed to by the array -strings-
  118.      *  -tmp_format- is a working copy to be used by this procedure (to avoid
  119.      *  "clobbering" string constants).
  120.      */
  121.  
  122.     char *msg, *p;
  123.     char *tmp_format;
  124.     int    i;
  125.  
  126.     /* copy input format string */
  127.     tmp_format = emalloct((unsigned) strlen(in_format)+1, "errmsg-tmp");
  128.     strcpy(tmp_format, in_format);
  129.  
  130.     /* initialize msg to empty string */
  131.     msg = emalloct(1, "errmsg-1"); 
  132.     *msg = '\0';
  133.  
  134.     for (i = 0; i < nstrings; i++) {
  135.         p = strchr(tmp_format, '%');
  136.         if (p == 0) break;
  137.         *p = '\0';
  138.         if (p != tmp_format)
  139.             msg = strjoin(msg, tmp_format);
  140.         msg = strjoin(msg, strings[i]);
  141.         tmp_format = ++p;
  142.     }
  143.     if (tmp_format != '\0' )
  144.         msg = strjoin(msg, tmp_format);
  145.     if (p == 0) {
  146.         printf("error in proc insert, too few %c's\n", '%');
  147. #ifdef TBSN
  148.         while (*strings != DUMMY_STR)
  149.             msg = strjoin(msg, *strings++);
  150. #endif
  151.     }
  152.     return(msg);
  153. }
  154.  
  155. /*
  156.  * Following are variations of pass1_error that call the appropriate
  157.  * errmsg_ routine.
  158.  * The original (simple case) pass1_error is still in 4c.c
  159.  */
  160.  
  161. void pass1_error_id(char *msg, Symbol name, char *lrm_sec, Node node)
  162.                                                         /*;pass1_error_id */
  163. {
  164.     /* This procedure is invoked when a type error which requires a special
  165.      * message is encountered in resolve1.
  166.      */
  167.  
  168.     if (cdebug2 > 3) TO_ERRFILE("AT PROC :  pass1_error_id");
  169.  
  170.     if (!noop_error) errmsg_id(msg, name, lrm_sec, node);
  171.     noop_error = TRUE;    /* To avoid cascaded errors.*/
  172. }
  173.  
  174. void pass1_error_str(char *msg, char *str, char *lrm_sec, Node node)
  175.                                                         /*;pass1_error_str */
  176. {
  177.     /* This procedure is invoked when a type error which requires a special
  178.      * message is encountered in resolve1.
  179.      */
  180.  
  181.     if (cdebug2 > 3) TO_ERRFILE("AT PROC :  pass1_error");
  182.  
  183.     if (!noop_error) errmsg_str(msg, str, lrm_sec, node);
  184.     noop_error = TRUE;    /* To avoid cascaded errors.*/
  185. }
  186.  
  187. void pass1_error_l(char *msg1, char *msg2, char *lrm_sec, Node node)
  188.                                                         /*;pass1_error_l */
  189. {
  190.     /* This procedure is invoked when a type error which requires a special
  191.      * message is encountered in resolve1.
  192.      */
  193.  
  194.     if (cdebug2 > 3) TO_ERRFILE("AT PROC :  pass1_error_l");
  195.  
  196.     if (!noop_error) errmsg_l(msg1, msg2, lrm_sec, node);
  197.     noop_error = TRUE;    /* To avoid cascaded errors.*/
  198. }
  199.  
  200. char *build_full_names(Set symbols)                    /*;build_full_names */
  201. {
  202.     /* builds a string containing the full names (scope.name) of all Symbols
  203.      * in the set 'symbols`
  204.      */
  205.  
  206.     Symbol sym;
  207.     Forset fs;
  208.     char   *name, *name_string;
  209.  
  210.     /* TBSL: this should be improved to free extra storage !! */
  211.  
  212.     name_string = strjoin("","");
  213.     if (symbols == (Set)0) return(name_string);
  214.     FORSET(sym = (Symbol), symbols, fs);
  215.         name = ORIG_NAME(SCOPE_OF(sym));
  216.         /* skip internally generated block names */
  217.         if (name[0] == '#')
  218.             name = "#BLOCK.";
  219.         else
  220.             name = strjoin(name, ".");
  221.         name = strjoin(name, ORIG_NAME(sym));
  222.         name = strjoin(name, " ");
  223.         name_string = strjoin(name_string, name);
  224.     ENDFORSET(fs);
  225.     return(name_string);
  226. }
  227.  
  228. #ifdef ERRNUM
  229.  
  230. char *phrases[] = {
  231.     "",                        /*   0 */
  232.     "9.16",                        /*   1 */
  233.     "label hidden by inner declaration",        /*   2 */
  234.     "5.1",                        /*   3 */
  235.     "missing full declaration for %",        /*   4 */
  236.     "3.8.1",                    /*   5 */
  237.     "Name of separately compiled unit cannot be ",    /*   6 */
  238.     "an operator designator",            /*   7 */
  239.     "10.1",                        /*   8 */
  240.     "System error: invalid node %",            /*   9 */
  241.     "none",                        /*  10 */
  242.     "Invalid compilation unit",            /*  11 */
  243.     "% does not appear in previous with clause",    /*  12 */
  244.     "10.1.1",                    /*  13 */
  245.     "Unknown unit in with clause: %",        /*  14 */
  246.     "specification and stub for % are in different scopes", /*  15 */
  247.     "7.1, 9.1",                    /*  16 */
  248.     "Matching specification not found for stub %",    /*  17 */
  249.     "Subunit identifier not unique",        /*  18 */
  250.     "10.2",                        /*  19 */
  251.     "stubs can only appear in the outermost scope of a ", /*     20 */
  252.     "compilation unit",                /*  21 */
  253.     "cannot find stub for subunit %",        /*  22 */
  254.     "% is not an exception",            /*  23 */
  255.     "11.1",                        /*  24 */
  256.     "Duplicate exception name in handler",        /*  25 */
  257.     "11.2",                        /*  26 */
  258.     "Duplicate OTHERS in exception part",        /*  27 */
  259.     "RAISE statement not directly in exception handler", /*    28 */
  260.     "11.3",                        /*  29 */
  261.     "Invalid exception name",            /*  30 */
  262.     " parameter not allowed for functions",        /*  31 */
  263.     "6.5",                        /*  32 */
  264.     "Invalid use of limited type % for out parameter ", /*  33 */
  265.     "7.4.4",                    /*  34 */
  266.     "Separately compiled generics not supported",    /*  35 */
  267.     "Premature use of incomplete or private type %", /*  36 */
  268.     "7.4.1",                    /*  37 */
  269.     "Type of a generic formal object of mode IN must not", /*  38 */
  270.     " be a limited type",                /*  39 */
  271.     "12.1.1",                    /*  40 */
  272.     "Deferred constant cannot be default expression", /*  41 */
  273.     " for a generic parameter",            /*  42 */
  274.     "7.4.3",                    /*  43 */
  275.     "Initialization not allowed for IN OUT generic parameters", /*  44 */
  276.     "OUT generic formals objects not allowed",    /*  45 */
  277.     "Premature usage of type % before its full declaration", /*  46 */
  278.     "generic private type cannot have defaults for discriminants", /*  47 */
  279.     "12.1.2",                    /*  48 */
  280.     "invalid reference to %",            /*  49 */
  281.     "8.3(16)",                    /*  50 */
  282.     "not a generic ",                /*  51 */
  283.     "12.1, 12.3",                    /*  52 */
  284.     "Initializations not allowed for operators",    /*  53 */
  285.     "6.7",                        /*  54 */
  286.     "not a generic package",            /*  55 */
  287.     "12.1",                        /*  56 */
  288.     "Recursive instantiation not allowed",        /*  57 */
  289.     "12.3",                        /*  58 */
  290.     "Invalid recursive instantiation",        /*  59 */
  291.     "Too many actuals in generic instantiation",    /*  60 */
  292.     "Positional association after named one",    /*  61 */
  293.     "named associations not allowed for overloaded names", /*  62 */
  294.     "12.3(3)",                    /*  63 */
  295.     "Missing instantiation for generic parameter %", /*  64 */
  296.     "duplicate or erroneous named associations in instantiation", /*     65 */
  297.     "% is not an operator designator",        /*  66 */
  298.     "4.5",                        /*  67 */
  299.     "Instantiation of a generic in parameter cannot be a ", /*  68 */
  300.     " deferred constant",                /*  69 */
  301.     "Instantiation of generic in out parameter must be a variable", /*  70 */
  302.     "12.1.1, 12.3.1",                /*  71 */
  303.     "Instantiation of generic in out parameter ",    /*  72 */
  304.     "cannot be a conversion",            /*  73 */
  305.     "12.3.1",                    /*  74 */
  306.     "must be a variable",                /*  75 */
  307.     "instantiation of generic in out parameter % depends on a ", /*    76 */
  308.     "discriminant",                    /*  77 */
  309.     "invalid expression for instantiation of %",    /*  78 */
  310.     "Invalid type for instantiation of %",        /*  79 */
  311.     "12.3.2 - 12.3.5",                /*  80 */
  312.     "Invalid use of incomplete type in instantiation of %", /*  81 */
  313.     "Invalid use of private type in instantiation of %", /*    82 */
  314.     "Expect non-limited type to instantiate %",    /*  83 */
  315.     "12.3.2",                    /*  84 */
  316.     "discriminant mismatch in instantiation of %",    /*  85 */
  317.     "Instantiation of % must be unconstrained",    /*  86 */
  318.     "Usage of private type % requires instantiation with", /*  87 */
  319.     " constrained type",                /*  88 */
  320.     "expect access to % to instantiate %",        /*  89 */
  321.     "12.3.3",                    /*  90 */
  322.     "formal and actual designated types must be both ", /*  91 */
  323.     "constrained or unconstrained",            /*  92 */
  324.     "Expect access type to instantiate %",        /*  93 */
  325.     "12.3.5",                    /*  94 */
  326.     "Expect array type to instantiate %",        /*  95 */
  327.     "12.3.4",                    /*  96 */
  328.     "Expect constrained array type to instantiate %", /*  97 */
  329.     "Expect unconstrained array type to instantiate %", /*  98 */
  330.     "Dimensions of actual type do not match those of %", /*    99 */
  331.     "index or component type mismatch in instantiation", /* 100 */
  332.     " of array type %",                /* 101 */
  333.     "formal and actual array component type must be both ", /* 102 */
  334.     "invalid match for generic subprogram %",    /* 103 */
  335.     "12.3.6",                    /* 104 */
  336.     "Expression in size spec is not static",    /* 105 */
  337.     "13.2",                        /* 106 */
  338.     "Prefix of attribute is not type or first named subtype", /* 107 */
  339.     "Prefix of attribute is not task type or access type", /* 108 */
  340.     "expect fixed type in representation clause for SMALL", /* 109 */
  341.     "13.2(11)",                    /* 110 */
  342.     "expression for SMALL must be static",        /* 111 */
  343.     "Identifier is not an enumeration type",    /* 112 */
  344.     "13.3",                        /* 113 */
  345.     "Integer code is not distinct or violates ",    /* 114 */
  346.     "predefined ordering relation of type",        /* 115 */
  347.     "Component of aggregate in enumeration representation clause", /* 116 */
  348.     "is not static",                /* 117 */
  349.     "Identifier is not a record type",        /* 118 */
  350.     "13.4",                        /* 119 */
  351.     "Alignment clause must contain a static expression", /* 120 */
  352.     "Component % does not appear in record type",    /* 121 */
  353.     "Component % already occurs in clause",        /* 122 */
  354.     "Expression for component % must be static",    /* 123 */
  355.     "Range for component % must be static",        /* 124 */
  356.     "Invalid expression for range constraint",    /* 125 */
  357.     "3.3",                        /* 126 */
  358.     "RANGE attribute has wrong type for constraint", /* 127 */
  359.     "invalid use of 'RANGE in expression",        /* 128 */
  360.     "Format error in pragma",            /* 129 */
  361.     "Appendices B,F",                /* 130 */
  362.     "Unconstrained % in object declaration",    /* 131 */
  363.     "3.6.1, 3.7.2",                    /* 132 */
  364.     "Missing initialization in constant declaration", /* 133 */
  365.     "3.2",                        /* 134 */
  366.     "Wrong scope for type of deferred constant",    /* 135 */
  367.     "7.4",                        /* 136 */
  368.     "Invalid context for deferred constant",    /* 137 */
  369.     "3.2, 7.4",                    /* 138 */
  370.     "constants of a generic type cannot be deferred", /* 139 */
  371.     "a deferred constant must be defined with a type mark", /* 140 */
  372.     "% is not a deferred constant",            /* 141 */
  373.     "Invalid redeclaration of %",            /* 142 */
  374.     "8.3",                        /* 143 */
  375.     "incorrect type in redeclaration of %",        /* 144 */
  376.     "7.4, 7.4.1",                    /* 145 */
  377.     "Missing initialization in redeclaration of %", /* 146 */
  378.     "Initialization not available for entities of limited type", /* 147 */
  379.     "Expect literal expression in number declaration", /* 148 */
  380.     "Invalid use of discriminants",            /* 149 */
  381.     "3.7.1",                    /* 150 */
  382.     "missing discriminants in full type declaration", /* 151 */
  383.     "3.8",                        /* 152 */
  384.     "Incomplete type definition must be completed ", /* 153 */
  385.     " in the same scope in which it first appears", /* 154 */
  386.     "Invalid context for redeclaration of private type", /* 155 */
  387.     "Generic private type % cannot have declaration ", /* 156 */
  388.     "in private part",                /* 157 */
  389.     "Invalid use of type % before its full declaration", /* 158 */
  390.     "invalid use of type % within its definition or body", /* 159 */
  391.     "3.3,9.1",                    /* 160 */
  392.     "Invalid constraint on access type",        /* 161 */
  393.     "Invalid subtype indication: type is already constrained", /* 162 */
  394.     "Invalid type mark in subtype indication: %",    /* 163 */
  395.     "3.3, 3.6.1",                    /* 164 */
  396.     "premature derivation of derived or private type %", /* 165 */
  397.     "3.4, 7.4.1",                    /* 166 */
  398.     "discriminant mismatch in declaration",        /* 167 */
  399.     "cannot obtain derived type from %",        /* 168 */
  400.     "3.4",                        /* 169 */
  401.     "Bounds in an integer type definition must be static", /* 170 */
  402.     "3.5.4",                    /* 171 */
  403.     "Bounds in an integer type definition must be of some ", /* 172 */
  404.     "integer type",                    /* 173 */
  405.     "Expect static expression for digits",        /* 174 */
  406.     "3.5.7",                    /* 175 */
  407.     "Expect integer expression for DIGITS",        /* 176 */
  408.     "Invalid digits value in real type declaration", /* 177 */
  409.     "Precision not supported by implementation",    /* 178 */
  410.     "Expect static expression for delta",        /* 179 */
  411.     "Expression for delta must be of some real type", /* 180 */
  412.     "3.5.9",                    /* 181 */
  413.     "Missing range in Fixed type declaration",    /* 182 */
  414.     "Bound in range constraint of type definition must be static", /* 183 */
  415.     "3.5.7, 3.5.9",                    /* 184 */
  416.     "Invalid RANGE constraint for type",        /* 185 */
  417.     "Invalid constraint for type",            /* 186 */
  418.     "accurracy constraint cannot depend on a generic type", /* 187 */
  419.     "value for DIGITS must be positive",        /* 188 */
  420.     "value of DELTA must be positive",        /* 189 */
  421.     "expect static expression for DIGITS or DELTA", /* 190 */
  422.     "3.5.7,3.5.9",                    /* 191 */
  423.     "Invalid constraint for scalar type",        /* 192 */
  424.     "3.3.2",                    /* 193 */
  425.     "Constraints apply to all indices or none",    /* 194 */
  426.     "3.6.1",                    /* 195 */
  427.     "Unconstrained element type in array declaration", /* 196 */
  428.     "Array type is already constrained",        /* 197 */
  429.     "Incorrect no. of index constraints for type %", /* 198 */
  430.     "Invalid expression for index definition",    /* 199 */
  431.     "expect discrete type in discrete range",    /* 200 */
  432.     "Invalid index constraint for %",        /* 201 */
  433.     "Incomplete specification of default values for discriminants", /* 202 */
  434.     "Discriminant must have discrete type",        /* 203 */
  435.     "non conformance to previous declaration",    /* 204 */
  436.     "6.3.1",                    /* 205 */
  437.     "Invalid self-reference in definition of %",    /* 206 */
  438.     "3.1",                        /* 207 */
  439.     "Unconstrained % in component declaration",    /* 208 */
  440.     "Invalid type for constraint",            /* 209 */
  441.     "3.3, 3.7.2",                    /* 210 */
  442.     "Invalid constraint: Record type has no discriminant", /* 211 */
  443.     "3.7.1, 3.7.2",                    /* 212 */
  444.     "Positional associations after named ones",    /* 213 */
  445.     "3.7.2",                    /* 214 */
  446.     "Too many constraints for record type",        /* 215 */
  447.     "Expect discriminant names only in discriminant", /* 216 */
  448.     " constraint",                    /* 217 */
  449.     "Invalid discriminant name in discriminant constraint", /* 218 */
  450.     "3.7. 3.7.2",                    /* 219 */
  451.     "Duplicate constraint for discriminant %",    /* 220 */
  452.     "discriminants in named association must have same type", /* 221 */
  453.     "3.7.2(4)",                    /* 222 */
  454.     "Missing constraints for discriminants",    /* 223 */
  455.     "a discriminant appearing in a subtype indication ", /* 224 */
  456.     "must appear by itself",            /* 225 */
  457.     "Invalid discriminant name in variant part",    /* 226 */
  458.     "3.7.1, 3.7.3",                    /* 227 */
  459.     "invalid redeclaration of % in private part",    /* 228 */
  460.     "8.2(b)",                    /* 229 */
  461.     "invalid redeclaration of %",            /* 230 */
  462.     "3.8, 8.2",                    /* 231 */
  463.     "Invalid argument for attribute SIZE",        /* 232 */
  464.     "Annex A",                    /* 233 */
  465.     "bounds of range for membership op must be scalar", /* 234 */
  466.     "4.4",                        /* 235 */
  467.     "Invalid use of attribute BASE",        /* 236 */
  468.     "ambiguous entry name for attribute",        /* 237 */
  469.     "9.9",                        /* 238 */
  470.     "% has incorrect type. Expect %",        /* 239 */
  471.     "invalid reading of out parameter %",        /* 240 */
  472.     "6.2",                        /* 241 */
  473.     "premature use of deferred constant before its", /* 242 */
  474.     "full declaration",                /* 243 */
  475.     "invalid context for integer literal",        /* 244 */
  476.     "4.6(15)",                    /* 245 */
  477.     "invalid context for real literal",        /* 246 */
  478.     "Incorrect type for string literal. Expect %",    /* 247 */
  479.     "Invalid context for NULL",            /* 248 */
  480.     "3.8.2",                    /* 249 */
  481.     "No aggregate available for type %",        /* 250 */
  482.     "4.2",                        /* 251 */
  483.     "Context of allocator must be an access type",    /* 252 */
  484.     "4.8, 3.8",                    /* 253 */
  485.     "Invalid type for allocator. Expect %",        /* 254 */
  486.     "3.8, 4.8",                    /* 255 */
  487.     "ambiguous expression for conversion",        /* 256 */
  488.     "4.6",                        /* 257 */
  489.     "Invalid array conversion",            /* 258 */
  490.     "cannot convert to %",                /* 259 */
  491.     "Invalid universal expression in",        /* 260 */
  492.     " discrete range",                /* 261 */
  493.     "Incorrect type for expression. Expect %",    /* 262 */
  494.     "Second argument of VAL must be of some integer type", /* 263 */
  495.     "ambiguous argument for attribute VAL",        /* 264 */
  496.     "attribute must apply to selected component",    /* 265 */
  497.     "13.7.2",                    /* 266 */
  498.     "Missing explicit conversion from universal fixed value", /* 267 */
  499.     "3.5.9, 4.5.5",                    /* 268 */
  500.     "system error: strange op type %",        /* 269 */
  501.     "Missing explicit conversion from universal_real value ", /* 270 */
  502.     "4.5.6",                    /* 271 */
  503.     "Invalid context for mixed mode operation",    /* 272 */
  504.     "4.5.5, 4.10",                    /* 273 */
  505.     "Missing explicit conversion from ",        /* 274 */
  506.     "universal_fixed value ",            /* 275 */
  507.     "4.5.5",                    /* 276 */
  508.     "% not available on a limited type",        /* 277 */
  509.     "7.4.2",                    /* 278 */
  510.     "No positional arguments can appear after named ones", /* 279 */
  511.     "6.4",                        /* 280 */
  512.     "Invalid format for argument association",    /* 281 */
  513.     "% actual parameter no. % in call is not a variable", /* 282 */
  514.     "6.4.1",                    /* 283 */
  515.     "A null range in array aggregate must be the only choice", /* 284 */
  516.     "4.3.2.(3)",                    /* 285 */
  517.     "Component is not allowed to be specified more than once", /* 286 */
  518.     "4.3.(6)",                    /* 287 */
  519.     "Missing association in array aggregate",    /* 288 */
  520.     "aggregates not available for limited type %",    /* 289 */
  521.     "Invalid context for aggregate",        /* 290 */
  522.     "OTHERS choice not allowed in this context",    /* 291 */
  523.     "4.3.2",                    /* 292 */
  524.     "invalid type mark in array aggregate",        /* 293 */
  525.     "4.3",                        /* 294 */
  526.     "Non static choice in array aggregate must be the only choice", /* 295 */
  527.     "OTHERS must be the last aggregate component",    /* 296 */
  528.     "In a positional aggregate only named association ", /* 297 */
  529.     "allowed is OTHERS",                /* 298 */
  530.     "Invalid context for OTHERS and named associations", /* 299 */
  531.     "4.3.2(6)",                    /* 300 */
  532.     "Invalid use of literal in aggregate",        /* 301 */
  533.     "Expect aggregate for component of multidimensional aggregate", /* 302 */
  534.     "characters in a string literal must be directly visible", /* 303 */
  535.     "4.2(3)",                    /* 304 */
  536.     "Component type of context is not a character type", /* 305 */
  537.     "OTHERS must appear alone and last in a choice list", /* 306 */
  538.     "No value supplied for discriminant %",        /* 307 */
  539.     "4.3.1",                    /* 308 */
  540.     "Value for discriminant % must be static",    /* 309 */
  541.     "Undefined component name",            /* 310 */
  542.     "Duplicate value for component in aggregate",    /* 311 */
  543.     "choice in record aggregate must be selector name", /* 312 */
  544.     "Range choice not allowed in record aggregate", /* 313 */
  545.     "OTHERS choice must represent at least ",    /* 314 */
  546.     "one component",                /* 315 */
  547.     "OTHERS expression incompatible with %",    /* 316 */
  548.     "components on a choice list must have same type", /* 317 */
  549.     "Too many components for record aggregate",    /* 318 */
  550.     "No value supplied for component %",        /* 319 */
  551.     "expect task name ",                /* 320 */
  552.     "9.5",                        /* 321 */
  553.     "invalid use of task type outside of its own body", /* 322 */
  554.     "9.1",                        /* 323 */
  555.     "use of SYSTEM.ADDRESS requires presence of package SYSTEM", /* 324 */
  556.     "13.7.2, Annex A",                /* 325 */
  557.     "Undefined attribute: %",            /* 326 */
  558.     "Ambiguous call to one of %",            /* 327 */
  559.     "6.6, 8.3",                    /* 328 */
  560.     "Ambiguous operands for %",            /* 329 */
  561.     "6.7, 8.3",                    /* 330 */
  562.     "Ambiguous literal: %",                /* 331 */
  563.     "3.5.1, 4.7, 8.3",                /* 332 */
  564.     "ambiguous expression",                /* 333 */
  565.     "8.2, 8.3",                    /* 334 */
  566.     "TEXT_IO not instantiated nor defined for type", /* 335 */
  567.     "8.4, 14.4",                    /* 336 */
  568.     "invalid types for %",                /* 337 */
  569.     "invalid argument list for %",            /* 338 */
  570.     "no instance of % has type %",            /* 339 */
  571.     "3.5.1",                    /* 340 */
  572.     "Expect expression to yield type %",        /* 341 */
  573.     "Unexpected range in slice",            /* 342 */
  574.     "",                        /* 343 */
  575.     "assignment not available on a limited type",    /* 344 */
  576.     "incompatible types for assignment",        /* 345 */
  577.     "5.2",                        /* 346 */
  578.     "ambiguous types for assigment",        /* 347 */
  579.     "left-hand side in assignment is not a variable", /* 348 */
  580.     "Case expression not of discrete type",        /* 349 */
  581.     "3.7.3, 5.4",                    /* 350 */
  582.     "Case expression cannot be of a generic type",    /* 351 */
  583.     "5.4",                        /* 352 */
  584.     "Choice must have type %",            /* 353 */
  585.     "Case choice not static",            /* 354 */
  586.     "choice value(s) not in range of static ",    /* 355 */
  587.     "subtype of case expression",            /* 356 */
  588.     "Duplicate choice value(s)",            /* 357 */
  589.     "Missing OTHERS choice",            /* 358 */
  590.     "EXIT statement not in loop",            /* 359 */
  591.     "5.7",                        /* 360 */
  592.     "Invalid loop label in EXIT: %",        /* 361 */
  593.     "5.5, 5.7",                    /* 362 */
  594.     "attempt to exit from %",            /* 363 */
  595.     "invalid context for RETURN statement",        /* 364 */
  596.     "5.8",                        /* 365 */
  597.     "Procedure cannot return value",        /* 366 */
  598.     "Function must return value",            /* 367 */
  599.     "Duplicate identifier for label",        /* 368 */
  600.     "target of goto is not a label",        /* 369 */
  601.     "5.9",                        /* 370 */
  602.     "target of goto is not a reachable label",    /* 371 */
  603.     "attempt to jump out of %",            /* 372 */
  604.     "Incorrect no. of arguments for operator %",    /* 373 */
  605.     "Invalid argument profile for \"=\"",        /* 374 */
  606.     " /=     cannot be given an explicit definition",  /* 375 */
  607.     "library subprograms cannot be overloaded",    /* 376 */
  608.     "10.1(10)",                    /* 377 */
  609.     "Missing RETURN statement in function body",    /* 378 */
  610.     "Invalid use of incomplete type %",        /* 379 */
  611.     "default initialization only allowed for IN parameters", /* 380 */
  612.     "6.1",                        /* 381 */
  613.     "functions cannot have % parameters ",        /* 382 */
  614.     "Declaration does not match previous specification", /* 383 */
  615.     "Invalid statement: not procedure or entry call", /* 384 */
  616.     "Invalid procedure or entry call",        /* 385 */
  617.     "6.5, 9.5",                    /* 386 */
  618.     "Invalid statement",                /* 387 */
  619.     "Invalid call",                    /* 388 */
  620.     "Redeclaration of identifier %",        /* 389 */
  621.     "8.3, 8.4",                    /* 390 */
  622.     "invalid declaration of homograph %",        /* 391 */
  623.     "8.3(17)",                    /* 392 */
  624.     "= can only be defined for limited types",    /* 393 */
  625.     "Specification and body are in different scopes", /* 394 */
  626.     "Matching specification not found for body %",    /* 395 */
  627.     "Invalid context for private declaration",    /* 396 */
  628.     "7.4, 12.1.2",                    /* 397 */
  629.     "Invalid redeclaration ",            /* 398 */
  630.     "8.2",                        /* 399 */
  631.     "invalid use of type % before its full declaration", /* 400 */
  632.     "3.8.1, 7.4.1",                    /* 401 */
  633.     "Private type requires full declaration with non limited type", /* 402 */
  634.     "Private type cannot be fully declared as an unconstrained", /* 403 */
  635.     " array type",                    /* 404 */
  636.     "Private type without discriminants cannot be given ", /* 405 */
  637.     "full declaration with discriminants",        /* 406 */
  638.     "A private type with discriminants must be given ", /* 407 */
  639.     "full declaration with a discriminated type",    /* 408 */
  640.     "Use of type for an OUT parameter requires full ", /* 409 */
  641.     "declaration  with non limited type",        /* 410 */
  642.     "recursive definition of private type %",    /* 411 */
  643.     "7.2",                        /* 412 */
  644.     "Missing full declaration in private part for %", /* 413 */
  645.     "Redeclaration of % in private part",        /* 414 */
  646.     "7.2 , 7.4.1",                    /* 415 */
  647.     "Missing body for % %.%",            /* 416 */
  648.     "7.3",                        /* 417 */
  649.     "Missing full type declaration for incomplete type %", /* 418 */
  650.     "Cannot find package specification for %",    /* 419 */
  651.     "% is not supported in current implementation", /* 420 */
  652.     "Invalid type mark ",                /* 421 */
  653.     "identifier undeclared or not visible %",    /* 422 */
  654.     "Invalid reference to %",            /* 423 */
  655.     "Ambiguous identifier. Could be one of: %",    /* 424 */
  656.     "premature usage of %",                /* 425 */
  657.     "% not declared in %",                /* 426 */
  658.     "4.1.3, 8.3",                    /* 427 */
  659.     "Invalid prefix in qualified name",        /* 428 */
  660.     "4.1.3",                    /* 429 */
  661.     "Ambiguous name in selected component",        /* 430 */
  662.     "duplicate identifier: %",            /* 431 */
  663.     "Expect identifier in renaming",        /* 432 */
  664.     "8.5",                        /* 433 */
  665.     "not an exception",                /* 434 */
  666.     "not a package",                /* 435 */
  667.     "renaming with = can only rename an equality operator", /* 436 */
  668.     "invalid renaming",                /* 437 */
  669.     "function spec. does not match attribute",    /* 438 */
  670.     "8.5,12.3.6",                    /* 439 */
  671.     "attribute cannot be renamed as function",    /* 440 */
  672.     "existence of object % depends on a discriminant ", /* 441 */
  673.     "ambiguous subprogram name: %",            /* 442 */
  674.     "No match for subprogam specification ",    /* 443 */
  675.     "parameter modes do not match",            /* 444 */
  676.     "8.5(8)",                    /* 445 */
  677.     "ambiguous or invalid entry name in renaming",    /* 446 */
  678.     "invalid index on entry name (not entry family)", /* 447 */
  679.     "Cannot rename entry family as a whole",    /* 448 */
  680.     "Renamed entity must be an object",        /* 449 */
  681.     "Duplicate declaration of %",            /* 450 */
  682.     "undeclared package name %",            /* 451 */
  683.     "8.4, 10.1",                    /* 452 */
  684.     "% is not the name of a USEable package",    /* 453 */
  685.     "8.4",                        /* 454 */
  686.     "Accept statements can only appear in tasks",    /* 455 */
  687.     "Undefined entry name in ACCEPT ",        /* 456 */
  688.     "invalid index on entry (not entry family)",    /* 457 */
  689.     "Entry name in ACCEPT statement does not match any entry", /* 458 */
  690.     "Missing index for entry family.",        /* 459 */
  691.     "Invalid entry name in ACCEPT",            /* 460 */
  692.     "An accept_statement cannot appear within an ACCEPT for", /* 461 */
  693.     " the same entry",                /* 462 */
  694.     "Call to member of entry family requires one index", /* 463 */
  695.     "9.5, 3.6.1",                    /* 464 */
  696.     "invalid index. % is not an entry family",    /* 465 */
  697.     "context requires entry name ",            /* 466 */
  698.     "9.7.2, 7.3",                    /* 467 */
  699.     "Invalid entry name",                /* 468 */
  700.     "Missing index in name of member of entry family", /* 469 */
  701.     "Member of entry family requires a single index ", /* 470 */
  702.     "Undefined entry name in task : ",        /* 471 */
  703.     "ambiguous entry family name: %",        /* 472 */
  704.     "Invalid context for TERMINATE alternative",    /* 473 */
  705.     "9.7.1",                    /* 474 */
  706.     " expect task name is ABORT statement",        /* 475 */
  707.     "9.10",                        /* 476 */
  708.     "Invalid task type in ABORT statement",        /* 477 */
  709.     "attribute cannot be applied to unconstrained array type", /* 478 */
  710.     "3.6.2",                    /* 479 */
  711.     ""};
  712.  
  713. /* errmsg(text, text, node) -> errmsgn(enum, enum, node) */
  714. void errmsgn(int en, int lrm, Node node)                        /*;errmsgn*/
  715. {
  716.     errmsg(phrases[en], phrases[lrm], node);
  717. }
  718.  
  719. void id_errmsgn(int msg, Symbol name, int lrm, Node node)        /*;id_errmsgn*/
  720. {
  721.     errmsg_id(phrases[msg], name, phrases[lrm], node);
  722. }
  723.  
  724. void id_id_errmsgn(int msg, Symbol name1, Symbol name2, int lrm, Node node)
  725.                                                             /*;id_id_errmsgn*/
  726. {
  727.     errmsg_id_id(phrases[msg], name1, name2, phrases[lrm], node);
  728. }
  729.  
  730. void id_type_errmsgn(int msg, Symbol name, Symbol type, int lrm, Node node)
  731.                                                         /*;id_type_errmsgn*/
  732. {
  733.     errmsg_id_type(phrases[msg], name, type, phrases[lrm], node);
  734. }
  735.  
  736. void l_errmsgn(int msg1, int msg2, int lrm, Node node)            /*;l_errmsgn*/
  737. {
  738.     char *strjoin();
  739.     errmsg(strjoin(phrases[msg1], phrases[msg2]), phrases[lrm], node);
  740. }
  741.  
  742. void l1_errmsgn(char *msg1, int msg2, int lrm, Node node)        /*;l1_errmsgn*/
  743. {
  744.     char *strjoin();
  745.     errmsg(strjoin(msg1, phrases[msg2]), phrases[lrm], node);
  746. }
  747.  
  748. void l2_errmsgn(int msg1, char *msg2, int lrm, Node node)        /*;l2_errmsgn*/
  749. {
  750.     char *strjoin();
  751.     errmsg(strjoin(phrases[msg1], msg2), phrases[lrm], node);
  752. }
  753.  
  754. void l_id_errmsgn(int msg1, int msg2, Symbol name, int lrm, Node node)
  755.                                                             /*;l_id_errmsgn*/
  756. {
  757.     char *strjoin();
  758.     errmsg_id(strjoin(phrases[msg1], phrases[msg2]), name, phrases[lrm], node);
  759. }
  760.  
  761. void l_str_errmsgn(int msg1, int msg2, char *str, int lrm, Node node)
  762.                                                             /*;l_str_errmsgn*/
  763. {
  764.     errmsg_str(strjoin(phrases[msg1], phrases[msg2]), str, phrases[lrm], node);
  765. }
  766.  
  767. void nat_errmsgn(int msg, Symbol sym, int lrm, Node node)        /*;nat_errmsgn*/
  768. {
  769.     errmsg_nat(phrases[msg], sym, phrases[lrm], node);
  770. }
  771.  
  772. void nat_id_str_errmsgn(int msg, Symbol sym, Symbol name, char *str, int lrm,
  773.   Node node)                                            /*;nat_id_str_errmsgn*/
  774. {
  775.     errmsg_nat_id_str(phrases[msg], sym, name, str, phrases[lrm], node);
  776. }
  777.  
  778. void nval_errmsgn(int msg, Node name, int lrm, Node node)    /*;nval_errmsgn*/
  779. {
  780.     errmsg_nval(phrases[msg], name, phrases[lrm], node);
  781. }
  782.  
  783. void str_errmsgn(int msg, char *str, int lrm, Node node)        /*;str_errmsgn*/
  784. {
  785.     errmsg_str(phrases[msg], str, phrases[lrm], node);
  786. }
  787.  
  788. void str_id_errmsgn(int msg, char *str, Symbol name, int lrm, Node node)
  789.                                                             /*;str_id_errmsgn*/
  790. {
  791.     errmsg_str_id(phrases[msg], str, name, phrases[lrm], node);
  792. }
  793.  
  794. void str_num_errmsgn(int msg, char *str, int i, int lrm, Node node)
  795.                                                             /*;str_num_errmsgn*/
  796. {
  797.     errmsg_str_num(phrases[msg], str, i, phrases[lrm], node);
  798. }
  799.  
  800. void type_errmsgn(int msg, Symbol type, int lrm, Node node)    /*;type_errmsgn*/
  801. {
  802.     errmsg_type(phrases[msg], type, phrases[lrm], node);
  803. }
  804.  
  805. void type1_errmsgn(char *msg, Symbol type, int lrm, Node node)
  806.                                                             /*;type1_errmsgn*/
  807. {
  808.     errmsg_type(msg, type, phrases[lrm], node);
  809. }
  810. #endif
  811.